package com.mxchip.livestar.ui.call

import android.app.Application
import androidx.lifecycle.*
import com.mxchip.livestar.repository.RoomClientRepository
import com.videohigh.graham.Term
import com.videohigh.graham.TermAudioDevice
import com.videohigh.graham.TermVideoDevice

/**
 * 设备 数据管理类
 */
class RoomViewModel(application: Application) : AndroidViewModel(application) {

    val termIdsAll: LiveData<Set<Term>>
        get() = RoomClientRepository.termIdsAll

    val audioDevices: LiveData<List<TermAudioDevice>>
        get() = RoomClientRepository.micUserIds

    val isMyselfTheOnlyOneLeft: LiveData<Boolean>
        get() = RoomClientRepository.isMyselfTheOnlyOneLeft

    val avDevices: LiveData<List<TermVideoDevice>>
        get() = RoomClientRepository.avDevices

    override fun onCleared() {
        super.onCleared()
        RoomClientRepository.clear()
    }

}
